import Cookies from 'js-cookie'

// 添加/修改 cookie
const setCookie = (name: string, value: string | object, time: number | Date| undefined, path: string, secure: boolean) => {
    return Cookies.set(name, value, { 'expires': time, path, secure })
}
// 获取cookie
const getCookie = (name: string) => {
    return Cookies.get(name)
}
// 获取Object cookie
const getCookieJson = (name: string) => {
    return Cookies.getJSON(name)
}
// 删除 单个cookie
const romveCookie = (name: string) => {
    return Cookies.remove(name)
}

export default { setCookie, getCookie, romveCookie, getCookieJson }